package com.zretc.controller;

import com.github.pagehelper.PageInfo;
import com.zretc.entity.Employee;
import com.zretc.entity.PaySalary;
import com.zretc.entity.ResponseResult;
import com.zretc.service.PaySalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/paysalary")
public class PaySalaryContorller {

    @Autowired
    private PaySalaryService paySalaryService;


    @RequestMapping("/get")
    public ResponseResult getByPage(Integer page, Integer size, String name,String payDate){

        System.out.println(payDate);
        System.out.println(name);
        Map<String,Object> map=new HashMap<>();
        map.put("page",page);
        map.put("size",size);
        map.put("name",name);
        map.put("payDate",payDate);

        PageInfo<PaySalary> by = paySalaryService.findBy(map);

        return ResponseResult.ok("查询成功",by);
    }
}
